/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hu.elte.progelm.web.client.main;

import hu.elte.progelm2.ejb.entity.Treetypes;
import hu.elte.progelm2.ejb.simulator.SimulatorRemote;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 *
 * @author ntb
 */
public class Viewer {

    private List<Treetypes> trees = new ArrayList<Treetypes>();
    private List<File> images = new ArrayList<File>();
    private Context ctx;
    private SimulatorRemote simulator;

    public Viewer() {
        try {
            ctx = new InitialContext();
            simulator = (SimulatorRemote) ctx.lookup("Simulator/remote");
            trees = simulator.getTreeTypes();
        } catch (NamingException ex) {
            Logger.getLogger(Viewer.class.getName()).log(Level.SEVERE, null, ex);
        }
    }


    public void takeSelection(){
        System.out.println("Event Called");
        System.out.println(selectedTree.getName());
    }

    public List<Treetypes> getTrees() {
        return trees;
    }

    public void setTrees(List<Treetypes> trees) {
        this.trees = trees;
    }

    private Treetypes selectedTree;

    public Treetypes getSelectedTree() {
        return selectedTree;
    }

    public void setSelectedTree(Treetypes selectedTree) {
        this.selectedTree = selectedTree;
    }
    
}
